<template>
  <!-- 单选 -->
  <input type="checkbox" @change="SelectChange" :checked="item.Select"> --- 商品名:{{ item.name }} --- 商品价格:{{ item.commodityPrice }} 
  
  <!-- + - -->
  --- <button @click="add(1)">+</button> {{ item.num || 1 }} <button @click="add(-1)">-</button> --- 小计: {{ (item.num || 1)*item.commodityPrice }}
</template>

<script>
export default {
  props:['item'],

  methods:{
    add(actionType){
      this.$emit('add',actionType)
    },
    SelectChange(){
      this.$emit('SelectChange')
    }
  }
}
</script>